//
//  FirstVC.swift
//  SwiftDemo
//
//  Created by xinchen on 2023/7/7.
//

import Foundation
import UIKit

class FirstVC: UIViewController {
    
    


    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        self.view.backgroundColor = UIColor.cyan
        
        let button = UIButton.init(frame: CGRect(x: 50, y: 120, width: 120, height: 50))
        button.setTitle("click", for: .normal)
        button.backgroundColor = .brown
        button.addTarget(self, action: #selector(clickAction), for: .touchUpInside)
        self.view.addSubview(button)
        
    }
    
    @objc func clickAction() {
        self.dismiss(animated: true)
        
    }

    deinit {
        print("FirstVC deinit")
    }

}
